package com.ftg.learn.smhtml.mapper;


import com.ftg.learn.smhtml.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DemoMapper {
    @SelectProvider(type=DeptSql.class,method="getShowAllSql")
    public List<Dept> showAll(String id, int begin, int end);

    @Insert("insert into product(pid,pname,pdescribe,ppicture,ptime,ptype,pteam) values(#{pid},#{pname},#{pdescribe},#{ppicture},#{ptime},#{ptype},#{pteam})")
    public int addDept(Dept dept);

    @Delete("delete from product where pid = #{id}")
    public void delDept(String id);

    @Select("select * from product where pid=#{id}")
    public Dept findOne(String id);

    @Update("update product set pname=#{pname},pdescribe=#{pdescribe},ppicture=#{ppicture},ptime=#{ptime},ptype=#{ptype},pteam=#{pteam} where pid = #{pid}")
    public int updateDept(Dept dept);

    @SelectProvider(type=DeptSql.class,method="getCountSql")
    public List<Dept> getCount(String id);
}